﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace Obra.SmugMug.Api
{
    /// <summary>
    /// SmugMug client specific methods to ease development.
    /// </summary>
    /// <remarks>
    /// <para>
    /// There are two interfaces for SmugMug albums to support unit testing,
    /// and to make the WCF client easier to use.  WCF does not (cannot?) use
    /// the query part of (?...) the URL to disambiguate from other URLs when
    /// running a REST server.  This means the following URls are equivalent.
    /// </para>
    /// <para>
    ///   + http://localhost/smugmug?method=change&OptionA=stringA
    ///   + http://localhost/smugmug?method=change&OptionB=stringB
    /// </para>
    /// <para>
    /// These are the URL formats used for changing an albums settings.
    /// </para>
    /// <para>
    /// There are many settings that can be changed on an album.  I do not 
    /// want to call one method with >20 parameters just to change one value.
    /// I would much rather call one method to change one value.  Thankfully,
    /// the client is not so discriminating and does not care if it cannot
    /// disambiguate the URIs, therefore; I broke apart the album interface
    /// into two parts.  One used exclusively by the client for convenience,
    /// and one used by both.
    /// </para>
    /// <para>
    /// In other words, I do not want this.
    /// Bad:
    ///   void ChangeAlbumSetttings(
    ///      bool settingA,
    ///      bool settingB,
    ///      bool settingC,
    ///      ...
    ///      bool settingZ);
    /// </para>
    /// <para>
    /// I want this.
    /// Good:
    ///   + void ChangeAlbumSettingA(bool SettingA);
    ///   + void ChangeAlbumSettingB(bool SettingB);
    ///   + void ChangeAlbumSettingCw(bool SettingC);
    ///   + ...
    ///   + void ChangeAlbumSettingZ(bool SettingZ);
    /// </para>
    /// <para>
    /// Unfortunately, it ain't all turtles.  SmugMug decided to support a URL
    /// parameter of false, but not true.  WCF automatically translates a 
    /// boolean to "true" or "false" depending upon the boolean's value.
    /// Instead, we have to send 1 for true and 0 for false.
    /// </para>
    /// </remarks>
    [ServiceContract]
    [XmlSerializerFormat]
    public interface ISmugMugAlbumsChangeSettings
    {
        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeBackprinting)]
        void ChangeAlbumBackprinting(
            string sessionId,
            int albumId,
            string backPrinting);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeCanRank)]
        void ChangeAlbumCanRank(
            string sessionId,
            int albumId,
            bool canRank);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeCategoryId)]
        void ChangeAlbumCategoryId(
            string sessionId,
            int albumId,
            int categoryId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeClean)]
        void ChangeAlbumClean(
            string sessionId,
            int albumId,
            bool clean);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeColorCorrection)]
        void ChangeAlbumColorCorrection(
            string sessionId,
            int albumId,
            int colorCorrection);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeComments)]
        void ChangeAlbumComments(
            string sessionId,
            int albumId,
            bool comments);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeCommunityId)]
        void ChangeAlbumCommunityId(
            string sessionId,
            int albumId,
            int communityId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeDefaultColor)]
        void ChangeAlbumDefaultColor(
            string sessionId,
            int albumId,
            bool defaultColor);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeDescription)]
        void ChangeAlbumDescription(
            string sessionId,
            int albumId,
            string description);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeExif)]
        void ChangeAlbumExif(
            string sessionId,
            int albumId,
            bool exif);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeExternal)]
        void ChangeAlbumExternal(
            string sessionId,
            int albumId,
            bool external);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeFamilyEdit)]
        void ChangeAlbumFamilyEdit(
            string sessionId,
            int albumId,
            bool familyEdit);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeFileNames)]
        void ChangeAlbumFileNames(
            string sessionId,
            int albumId,
            bool fileNames);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeFriendEdit)]
        void ChangeAlbumFriendEdit(
            string sessionId,
            int albumId,
            bool friendEdit);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeGeography)]
        void ChangeAlbumGeography(
            string sessionId,
            int albumId,
            bool geography);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeHeader)]
        void ChangeAlbumHeader(
            string sessionId,
            int albumId,
            bool header);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeHideOwner)]
        void ChangeAlbumHideOwner(
            string sessionId,
            int albumId,
            bool hideOwner);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeHighlightId)]
        void ChangeAlbumHighlightId(
            string sessionId,
            int albumId,
            int highlightId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeKeywords)]
        void ChangeAlbumKeywords(
            string sessionId,
            int albumId,
            string keywords);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeLarges)]
        void ChangeAlbumLarges(
            string sessionId,
            int albumId,
            bool larges);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeOriginals)]
        void ChangeAlbumOriginals(
            string sessionId,
            int albumId,
            bool originals);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangePassword)]
        void ChangeAlbumPassword(
            string sessionId,
            int albumId,
            string password);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangePasswordHint)]
        void ChangeAlbumPasswordHint(
            string sessionId,
            int albumId,
            string passwordHint);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangePosition)]
        void ChangeAlbumPosition(
            string sessionId,
            int albumId,
            int position);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangePrintable)]
        void ChangeAlbumPrintable(
            string sessionId,
            int albumId,
            bool printable);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeProofDays)]
        void ChangeAlbumProofDays(
            string sessionId,
            int albumId,
            int proofDays);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeProtected)]
        void ChangeAlbumProtected(
            string sessionId,
            int albumId,
            bool @protected);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangePublic)]
        void ChangeAlbumPublic(
            string sessionId,
            int albumId,
            bool @public);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeShare)]
        void ChangeAlbumShare(
            string sessionId,
            int albumId,
            bool share);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeSmugSearchable)]
        void ChangeAlbumSmugSearchable(
            string sessionId,
            int albumId,
            bool smugSearchable);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeSortDirection)]
        void ChangeAlbumSortDirection(
            string sessionId,
            int albumId,
            bool sortDirection);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeSortMethod)]
        void ChangeAlbumSortMethod(
            string sessionId,
            int albumId,
            string sortMethod);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeSubCategoryId)]
        void ChangeAlbumSubCategoryId(
            string sessionId,
            int albumId,
            int subCategoryId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeTemplateId)]
        void ChangeAlbumTemplateId(
            string sessionId,
            int albumId,
            int templateId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeTitle)]
        void ChangeAlbumTitle(
            string sessionId,
            int albumId,
            string title);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeUnsharpAmount)]
        void ChangeAlbumUnsharpAmount(
            string sessionId,
            int albumId,
            float unsharpAmount);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeUnsharpRadius)]
        void ChangeAlbumUnsharpRadius(
            string sessionId,
            int albumId,
            float unsharpRadius);


        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeUnsharpSigma)]
        void ChangeAlbumUnsharpSigma(
            string sessionId,
            int albumId,
            float unsharpSigma);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeUnsharpThreshold)]
        void ChangeAlbumUnsharpThreshold(
            string sessionId,
            int albumId,
            float unsharpThreshold);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeWatermarking)]
        void ChangeAlbumWatermarking(
            string sessionId,
            int albumId,
            bool watermarking);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeWatermarkId)]
        void ChangeAlbumWatermarkId(
            string sessionId,
            int albumId,
            int watermarkId);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeWorldSearchable)]
        void ChangeAlbumWorldSearchable(
            string sessionId,
            int albumId,
            bool worldSearchable);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeXLarges)]
        void ChangeAlbumXLarges(
            string sessionId,
            int albumId,
            bool xLarges);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeX2Larges)]
        void ChangeAlbumX2Larges(
            string sessionId,
            int albumId,
            bool x2Larges);

        [OperationContract]
        [WebGet(UriTemplate = UriTemplates.Albums.ChangeX3Larges)]
        void ChangeAlbumX3Larges(
            string sessionId,
            int albumId,
            bool x3Larges);
    }
}
